package com.csgsystems.im.module.action.example;

import java.util.List;

import com.csgsystems.im.struts2.action.BaseActionSupport;
import com.csgsystems.im.survey.Survey;
import com.csgsystems.im.survey.persistence.LanguageDao;
import com.csgsystems.im.survey.persistence.SurveyDao;

public class ListAction extends BaseActionSupport {

	/**
	 *
	 */
	private static final long serialVersionUID = 1699897620921371209L;

	private LanguageDao languageDao = null;
	private SurveyDao surveyDao = null;
	private List<Survey> results = null;

	public List<Survey> getResults() {
		return results;
	}


	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		results = surveyDao.findByHierarchyItem(847);		// Will be tied into users hierarchyItemId
		getSession().setAttribute("exampleEntities", results);

		return SUCCESS;
	}

	public void setSurveyDao(SurveyDao surveyDao) {
		this.surveyDao = surveyDao;
	}
	
	public LanguageDao getLanguageDao() {
		return languageDao;
	}

	public void setLanguageDao(LanguageDao languageDao) {
		this.languageDao = languageDao;
	}

}
